<template>
    <div class="content_left_bottom">
        <div class="content_bottom_one">
            <div class="zoom">
                <i></i>
                <span>{{ zoomVal | takeTwoDecimal}}</span>
            </div>
            <div class="rotate_out" @click="setImgRotate">
                <i></i>
                <span>{{rotateDeg === 2 ? '90' : rotateDeg === 3 ? '180' : rotateDeg === 4 ? '270' : '0'}} °</span>
            </div>
            <div class="mdfigy_rate_out" :class="{sel : modifyTipsShow}" @click="modifyTipsShow = !modifyTipsShow">
                <i></i>
                <span>修改率: {{modifyRate}}%</span>
            </div>
        </div>
        <div class="content_bottom_two">
            <div class="number" style="margin-right: 56px;">
                <span>快速弹框 ：</span>
                <label for="blBox" class="switch-cp">
                    <input id="blBox" class="switch-cp__input" v-model="checkboxsGroup.showEditPop" type="checkbox" 
                        :disabled="hasChangeHistory">
                    <div class="switch-cp__box" :class="{'switch-cp__box2' : checkboxsGroup.showEditPop}"></div>
                </label>
            </div>
            <div class="number" style="margin-right: 56px;">
                <span>继承层级 ：</span>
                <label for="switchCJ" class="switch-cp">
                    <input id="switchCJ" class="switch-cp__input" v-model="checkboxsGroup.hierarchy" type="checkbox" 
                    :disabled="hasChangeHistory" 
                    @click="!hasChangeHistory && inheritHierarchy()">
                    <div class="switch-cp__box" :class="{'switch-cp__box2' : checkboxsGroup.hierarchy}"></div>
                </label>
            </div>
            <div class="number">
                <span>显示编号：</span>
                <label for="switchCP" class="switch-cp">
                    <input id="switchCP" class="switch-cp__input" v-model="checkboxsGroup.serial" type="checkbox" 
                    :disabled="hasChangeHistory" @click="!hasChangeHistory && showTextContent()">
                    <div class="switch-cp__box" :class="{'switch-cp__box2' : checkboxsGroup.serial}"></div>
                </label>
            </div>
            <div class="inherit">
                <span>继承属性：</span>
                <label for="switch" class="switch-cp">
                    <input id="switch" class="switch-cp__input" v-model="checkboxsGroup.inHeritAttr" type="checkbox" :disabled="hasChangeHistory">
                    <div class="switch-cp__box" :class="{'switch-cp__box2' : checkboxsGroup.inHeritAttr}"></div>
                </label>
            </div>
        </div>
        <!-- <div class="modify_rate_tips_out" v-show="modifyTipsShow">
            <i>
                <span>标注修改率: {{pageModifyRate ? 
                    vm.currentDrawData.markModifyRate : 
                    base.step === 0 ? averageModifyRate : files.current.averageRate1 }}%</span>
                <span v-if="base.step === 1 || base.step === 2">检查修改率: {{pageModifyRate ?
                    vm.currentDrawData.checkModifyRate : 
                    base.step === 1 ? averageModifyRate : files.current.averageRate2 }}%</span>
                <span v-if="base.step === 2">质检修改率: {{pageModifyRate ? 
                    vm.currentDrawData.qualityModifyRate : 
                    base.step === 2 ? averageModifyRate : files.current.averageRate3 }}%</span>
            </i>
        </div> -->
    </div>
</template>

<script>
// import $ from 'jquery'
export default {
    name: 'bottomControl',
    data(){
        return {
            modifyTipsShow: false, // 修改率显示隐藏
        }
    },
    props: {
        zoomVal: {
            type: Number,
            default: 0,
        },
        rotateDeg: {
            type: Number,
            default: 0,
        },
        modifyRate: {
            type: Number,
            default: 0
        },
        checkboxsGroup: {
            type: Object,
            default: () => ({})
        },
        hasChangeHistory: {
            type: Boolean,
            default: false
        }
    },
    methods: {
        setImgRotate(){
            this.$emit('setImgRotate')
        },
        showTextContent(){
            this.$emit('showTextContent')
        },
        inheritHierarchy(){
            this.$emit('inheritHierarchy')
        }
    },
    filters: {
        takeTwoDecimal: function(val) {
            var type = typeof val;
            if (type !== "number") {
                return "100%";
            }
            return Math.ceil((val * 100).toFixed(2)) + "%";
        },
    }
};
</script>

<style lang="less" scoped>
.content_left_bottom {
    flex-flow: row nowrap;
    background: #787878;
    width: 100%;
    height: 28px;
    position: absolute;
    z-index: 6;
    bottom: 0;
}

.content_left_bottom .content_bottom_one {
    margin-left: 20px;
}

.content_left_bottom .content_bottom_one .zoom {
    float: left;
    color: #393939;
    font-size: 12px;
    line-height: 28px;
}
.content_left_bottom .content_bottom_one .zoom i {
    display: inline-block;
    position: relative;
    top: 2px;
    left: 0;
    margin-right: 5px;
    width: 12px;
    height: 12px;
    background: url('');
    background-repeat: no-repeat;
}

.content_left_bottom .content_bottom_one .light {
    float: right;
    color: #393939;
    font-size: 12px;
    line-height: 28px;
}

.content_left_bottom .content_bottom_one .light i {
    display: inline-block;
    position: relative;
    top: 3px;
    left: 0;
    margin: 0 5px 0 20px;
    width: 14px;
    height: 14px;
    background: url('');
}

.content_left_bottom .content_bottom_two {
    display: flex;
    flex-flow: row nowrap;
    margin-right: 30px;
    float: right;
}

.content_left_bottom .content_bottom_two .number {
    position: relative;
    margin-right: 40px;
}

.content_left_bottom .content_bottom_two .number span {
    font-size: 12px;
    color: #393939;
    line-height: 28px;
}

.content_left_bottom .content_bottom_two .number i {
    display: inline-block;
    position: relative;
    top: 2px;
    left: 0;
    cursor: pointer;
    width: 24px;
    height: 12px;
    background: url('');
}

.content_left_bottom .content_bottom_two .inherit {
    margin: 0 20px;
    position: relative;
}

.content_left_bottom .content_bottom_two .inherit span {
    font-size: 12px;
    color: #393939;
    line-height: 28px;
}

.content_left_bottom .content_bottom_two .inherit i {
    display: inline-block;
    position: relative;
    top: 2px;
    left: 0;
    cursor: pointer;
    width: 24px;
    height: 12px;
    background: url('');
}

.content_left_bottom .content_bottom_two .bubble span {
    font-size: 12px;
    color: #393939;
    line-height: 28px;
}

.content_left_bottom .content_bottom_two .bubble i {
    display: inline-block;
    position: relative;
    top: 2px;
    left: 0;
    cursor: pointer;
    width: 24px;
    height: 12px;
    background: url('');
}
.rotate_out{
    float: left;
    color: #393939;
    font-size: 12px;
    line-height: 29px;
    margin-left: 12px;
    cursor: pointer;
    user-select: none;
    padding: 0 0 0 10px;
}
.rotate_out>i{
    display: inline-block;
    position: relative;
    top: 3px;
    left: 0;
    width: 24px;
    height: 16px;
    background: url();
    background-repeat: no-repeat;
    background-size: 100% auto;
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}
.rotate_out>span{
    color: #393939;
    font-size: 12px;
    line-height: 28px;
}
.mdfigy_rate_out.sel{
    background-color: #858585;
}

.mdfigy_rate_out{
    float: left;
    color: #393939;
    font-size: 12px;
    line-height: 29px;
    margin-left: 12px;
    cursor: pointer;
    user-select: none;
    padding: 0 10px;
}
.mdfigy_rate_out>i{
    display: inline-block;
    position: relative;
    top: 3px;
    left: 0;
    width: 20px;
    height: 16px;
    background-image: url('');
    background-repeat: no-repeat;
    background-size: auto 100%;
}
.switch-cp {
    display: inline-block;
    top: 8px;
    left: 65px;
    position: absolute;
}

.switch-cp__input {
    float: left;
    opacity: 0;
}

.switch-cp__input:checked~.switch-cp__box {
    border-color: #5d5d5d;
    background-color: #5d5d5d;
    display: block;
    position: relative;
    width: 24px;
    height: 13px;
    outline: 0;
    border-radius: 7px;
    box-sizing: border-box;
    background-color: #98b075;
    -webkit-transition: background-color 0.1s, border 0.1s;
    transition: background-color 0.1s, border 0.1s;
}

.switch-cp__input:checked~.switch-cp__box:before {
    -webkit-transform: scale(0);
    transform: scale(0);
}

.switch-cp__box:before {
    content: ' ';
    position: absolute;
    top: 0;
    left: 0;
    width: 25px;
    height: 12px;
    border-radius: 6px;
    background-color: #8d8d8d;
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
    transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
}

.switch-cp__input:checked~.switch-cp__box:after {
    -webkit-transform: translateX(13px);
    transform: translateX(13px);
}

.switch-cp__box:after {
    content: ' ';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 6px;
    background-color: #5d5d5d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35),
        -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
}
.switch-cp__box2:after {
    content: ' ';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 6px;
    background-color: #e5ebde;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35),
        -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
}
.modify_rate_tips_out{
    width: 136px;
    position: absolute;
    left: 14px;
    bottom: 44px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    animation: fadeUp .4s 0s both;
    -webkit-animation:fadeUp .4s 0s both;
    user-select: none;
}
.modify_rate_tips_out>i{
    font-style: normal;
}
.modify_rate_tips_out span{
    color: #A9A9A9;
    font-size: 12px;
    display: block;
    text-align: left;
    margin-bottom: 2px;
}
</style>
